/*
 * Copyright (C) 2012  Romain DUBOIS
 * 
 * This file is part of NeMoS - Network and Modular Software
 * 
 * NeMoS is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * NeMoS is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with NeMoS.  If not, see <http://www.gnu.org/licenses/>.
 */
package nemos.swing;

import java.util.Collection;

import javax.swing.Action;

/**
 * IActionProvider : The action provider interface.
 * 
 * <p>
 * Services registered under this interface provide Swing {@link Action}s. Each
 * action is designed by a String ID. This interface separates the components
 * displaying the action (buttons, menu items, ...) from the controllers which
 * decide when the action is available.
 * </p>
 * 
 * @author Romain DUBOIS
 */
public interface IActionProvider {

	/**
	 * Get an action from its ID.
	 * 
	 * @param pActionId
	 *            The action ID
	 * @return The identified action, or {@code null} if no action with this ID
	 *         is managed by this provider
	 */
	Action getAction(String pActionId);

	/**
	 * Get the available action IDs. Available actions IDs are not expected to
	 * be a service property because it can change during the service life and
	 * service property modification is avoided when possible.
	 * 
	 * @return The IDs of the available actions
	 */
	Collection<String> getAvailableActionIds();
}
